﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Biblio2.LocalParsing
{
    public partial class LocalParsingUserControl : UserControl
    {
        #region Constructeur
        public LocalParsingUserControl()
        {
            InitializeComponent();
        }
        #endregion Constructeur

        #region Attributs
        public enum Step
        {
            None,
            Step1,
            Step2,
            Step3,
            Step4,
        }

        private Step m_currentStep = Step.None;
        #endregion Attributs

        #region Event
        private void importStartButton_Click(object sender, EventArgs e)
        {
            if (m_currentStep == Step.None)
                LocalParsingManager.StartLocalParsing();
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            LocalParsingManager.CancelLocalParsing();
        }
        #endregion Event


        #region Accesseurs
        public Step1UserControl Step1UC { get { return step1UserControl; } }
        public FileListEditUserControl FileListEditUC { get { return fileListEditUserControl21; } }
        #endregion Accesseurs

        #region Public
        public void SetStep(Step aStep)
        {
            if (aStep != m_currentStep)
            {
                switch (aStep)
                {
                    case Step.None:
                        step1UserControl.Visible = false;
                        step1UserControl.Init();
                        importStartButton.Visible = true;
                        cancelNextPanel.Visible = false;
                        fileListEditUserControl21.CancelFilesInfosEdition();
                        break;
                    case Step.Step1:
                        step1UserControl.Visible = true;
                        importStartButton.Visible = false;
                        cancelNextPanel.Visible = true;
                        break;
                }

                m_currentStep = aStep;
            }
        }
        #endregion Public


    }
}
